/**
 * 
 */
package org.vsg.stock.core.indicator.kline;

import java.util.Date;
import java.util.List;

import org.vsg.stock.core.kline.DailyKLineStock;

/**
 * @author Bill Vison
 *
 */
public class DefaultTrendingCycle extends TrendingCycle {
	


	/* (non-Javadoc)
	 * @see org.vsg.stock.core.indicator.kline.TrendingCycle#getStartDate()
	 */
	@Override
	Date getStartDate() {
		DailyKLineStock dks = this.selectedCycleList.get(0);
		return dks.getDate();
	}


	
	/* (non-Javadoc)
	 * @see org.vsg.stock.core.indicator.kline.TrendingCycle#getEndDate()
	 */
	@Override
	Date getEndDate() {
		DailyKLineStock dks = this.selectedCycleList.get( selectedCycleList.size() -1 );
		return dks.getDate();
	}

	private List<DailyKLineStock> selectedCycleList;
	
	/* (non-Javadoc)
	 * @see org.vsg.stock.core.indicator.kline.TrendingCycle#getSelectedCycleList()
	 */
	@Override
	List<DailyKLineStock> getSelectedCycleList() {
		// TODO Auto-generated method stub
		return this.selectedCycleList;
	}




	public void setSelectedCycleList(List<DailyKLineStock> selectedCycleList) {
		this.selectedCycleList = selectedCycleList;
	}



	/* (non-Javadoc)
	 * @see org.vsg.stock.core.indicator.kline.TrendingCycle#getLength()
	 */
	@Override
	int getLength() {
		// TODO Auto-generated method stub
		return selectedCycleList.size();
	}

	/* (non-Javadoc)
	 * @see org.vsg.stock.core.indicator.kline.TrendingCycle#getTrending()
	 */
	@Override
	Trending getTrending() {
		// TODO Auto-generated method stub
		return trending;
	}
	
	private Trending trending;
	void setTrending(Trending trending) {
		this.trending = trending;
	}



	@Override
	public String toString() {
		return "DefaultTrendingCycle [getStartDate()=" + getStartDate()
				+ ", getEndDate()=" + getEndDate() + ", getLength()="
				+ getLength() + ", getTrending()=" + getTrending() + "]";
	}

	
	
	
}
